<%--管理员教师插入数据处理页面--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="java.sql.*"%>
<%@page import="org.edu.system.DBConnect"%>
<%@page import="org.edu.system.LogWriter" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>数据库插入</title>
</head>
<body>
<%
String adm_id = (String) (session.getAttribute("UserName"));
request.setCharacterEncoding("utf-8");
String id = request.getParameter("id");
String username = request.getParameter("username");
String gender = request.getParameter("gender");
String passwd = request.getParameter("passwd");
String college = request.getParameter("college");
String phone = request.getParameter("phone");
String identity = request.getParameter("identity");
String location = request.getParameter("location");
String sql_select = "INSERT INTO teacher(tc_id,tc_name,tc_gender,tc_passwd,tc_college,tc_phone,tc_identity,tc_location) VALUES ('"
		+ id + "','" + username + "','" + gender + "','" + passwd + "','" + college + "','" + phone + "','"
		+ identity + "','" + location + "')";
try{
	Connection con = DBConnect.getCon();
	System.out.println(sql_select);
	PreparedStatement pst = con.prepareStatement(sql_select);
	int rs = pst.executeUpdate();
	System.out.println(pst);
	System.out.println(rs);
	LogWriter.LogPrint("["+request.getRemoteAddr()+"] "+adm_id+" 添加教师记录成功！");
%>
<jsp:forward page="adm_teacher_info.jsp">
	<jsp:param name="ids" value="id"/>
</jsp:forward>
<%
}catch(Exception e){
	out.println(e);
}
%>
</body>
</html>